﻿/// <reference path="duomi.common.js" />
/// <reference path="duomi.common.ajax.js" />
/*************************************************************
Base Common Session Function Js.
远程(跨域)Ajax请求
Create By Ming.ma
2014-08-06 V1.0
*************************************************************/
Namespace.register("$ext.session");

(function () {
    $ext.session = {
        $description: 'session 相关操作',
        $author: 'Ming.ma',
        $version: '1.0.0',
        //是否登录
        isLogin: function () { return getCurrentSession() != ''; },
        //获取当前Session {id:'',name:''}
        getCurrentSession: function () { return getCurrentSession(); }
    };
    var $handlerPath = "/Controls/Common/CommonHandler.ashx?action=GETCURRENTSESSION";
    function getCurrentSession() {
        return $ajax.ajax({ url: $handlerPath, type: 'get', encoding:'UTF-8', async: false }).responseText;
    }

})();